<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/debug/debug.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_44d5bc2300862405dbe586a8cb303c4f.html">debug</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">debug.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="debug_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __DEBUG_H__</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define __DEBUG_H__</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160; </div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#if _DEBUG || defined(DEBUG)</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#   include &lt;typeinfo&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#   include &lt;stdio.h&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#   include &lt;iostream&gt;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#   define DPRINTF printf</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#   define PRINT_CONT(os, first, end) print_cont(os, first, end)</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160; </div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Iterator&gt;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> print_cont(std::ostream&amp; os, Iterator f, Iterator l)</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;{</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;    <span class="keywordflow">for</span> (; f != l; ++f)</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;        os &lt;&lt; *f &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    os &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;}</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="debug_8h.html#ab2759269c92e6d05675a698378dac492">   20</a></span>&#160;<span class="preprocessor">#   define DPRINTF</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="debug_8h.html#a7d4a7df693810981e84483eff4392eb1">   21</a></span>&#160;<span class="preprocessor">#   define PRINT_CONT(os, first, end)</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="debug_8h.html#a0572954070a5f8e650d85dcf9cfa6886">   24</a></span>&#160;<span class="preprocessor">#define WRITELOGMSG(head, msg, nLogLevel){ if(_bWriteLog) LOG_TOOLS(nLogLevel) &lt;&lt; head &lt;&lt; msg; }</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="debug_8h.html#a75d95534e46e1196cebfec8bd6e034f0">   25</a></span>&#160;<span class="preprocessor">#define WRITELOGERROR(head, ec, nLogLevel){ if(_bWriteLog) LOG_TOOLS(nLogLevel) &lt;&lt; head &lt;&lt; ec.GetErrorMsg().c_str(); }</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="debug_8h.html#aaa7067fcb9c7edfb0c745246fc8b17bb">   26</a></span>&#160;<span class="preprocessor">#define WRITELOGINT(head, nValue, nLogLevel) { if(_bWriteLog) LOG_TOOLS(nLogLevel) &lt;&lt; head &lt;&lt; nValue; }</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="debug_8h.html#a736bb8d3b2268fbc0387b29df9b57afb">   27</a></span>&#160;<span class="preprocessor">#define WRITELOGPTR(head, nPtr, nLogLevel) { if(_bWriteLog) LOG_TOOLS(nLogLevel) &lt;&lt; head &lt;&lt; nPtr; }</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="debug_8h.html#aa84e12b1ec18c569f70b403694ec5501">   28</a></span>&#160;<span class="preprocessor">#define WRITELOGTRACE2(head, param1, param2, nLogLevel) { if(_bWriteLog) LOG_TOOLS(nLogLevel) &lt;&lt; head &lt;&lt; param1 &lt;&lt; &quot;,&quot; &lt;&lt; param2; }</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="debug_8h.html#a4206114e3acb9926ad0871399847b3f2">   29</a></span>&#160;<span class="preprocessor">#define WRITELOGTRACE3(head, param1, param2, param3, nLogLevel) { if(_bWriteLog) LOG_TOOLS(nLogLevel) &lt;&lt; head &lt;&lt; param1 &lt;&lt; &quot;,&quot; &lt;&lt; param2 &lt;&lt; &quot;,&quot; &lt;&lt; param3; }</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="debug_8h.html#aaac4d60409186c69a366584893c9e074">   31</a></span>&#160;<span class="preprocessor">#define CHECK_REPEAT_KEY(container, key) { \</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">    if(_bWriteLog) \</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">    { \</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">        if (container.find(key) != container.end()){ \</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">            LOG_TOOLS(LOG_WARNING) &lt;&lt; &quot;repeat key value:&quot; &lt;&lt; key; \</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">        }\</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">    }\</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">}</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="debug_8h.html#aa12d2f8df4aa059bb905eb28e08f69de">   40</a></span>&#160;<span class="preprocessor">#define CHECK_PARAM_EMPTY_TRACE2(param, head, msg1, msg2) { \</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">    if(param.empty()) WRITELOGTRACE2(head, msg1, msg2, LOG_ERROR); \</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">}</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#endif // __DEBUG_H__</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
